#include <cstdlib>
#include <time.h>

#include "defines.h"
#include "manager.h"
#include "mapobj.h"
#include "monster.h"
#include "tile.h"

void initOColors();

int main( int argc, char * argv[] )
{
	//PDCurses initialization
	initscr(); // start pdcurses
	refresh(); // fixes a strange bug
	PDC_set_title( "Dungeons of Ololollo" );
	start_color();
	initOColors(); // initialize all the colors
	initRand(); // initialize random number generator
	noecho();
	curs_set( 0 ); // turn that nasty flashing cursor off
	cbreak();
	keypad( stdscr, TRUE ); // initializing arrows, F1-F12, etc
	srand( static_cast< unsigned int >( time( 0 ) ) ), rand(), rand(), rand();

	// Main game cycle
	manager.start();
	endwin();
	return 0;
};

void initOColors()
{
	init_pair( 1, COLOR_GREEN, COLOR_BLACK );
	init_pair( 2, COLOR_RED, COLOR_BLACK );
	init_pair( 3, COLOR_BLUE, COLOR_BLACK );
	init_pair( 4, COLOR_WHITE, COLOR_BLACK );
	init_pair( 5, COLOR_CYAN, COLOR_BLACK );
	init_pair( 6, COLOR_YELLOW, COLOR_BLACK );
	init_pair( 7, COLOR_MAGENTA, COLOR_BLACK );
	init_pair( 8, COLOR_RED, COLOR_RED );
}